package com.spring.batis.util;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor;
import org.springframework.core.PriorityOrdered;
import org.springframework.stereotype.Component;

public class ScanBeanDefinitionRegistyPostProcessor implements BeanDefinitionRegistryPostProcessor, PriorityOrdered {
	String packageName;

	public void setPackageName(String packageName) {
		this.packageName = packageName;
	}



	@Override
	public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException {
		CustomClassPathScan c = new CustomClassPathScan(registry);
		int scan = c.scan(packageName);
		System.out.println(scan);
	}












	@Override
	public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {

	}

	@Override
	public int getOrder() {
		return 0;
	}
}
